//
//  InitialShareSdk.m
//  ChiChiFan
//
//  Created by leidian on 15/8/6.
//  Copyright (c) 2015年 mumuxinxinCompany. All rights reserved.
//

#import "InitialShareSdk.h"

#define kWeiboAppKey      @"3818800252"
#define kWeiboAppSecret   @"69fef5e7d86eb692c272c3b6dffbb399"
#define kWeiboRedirectURI @"https://api.weibo.com/oauth2/default.html"

#define kWeChatAppKey     @"wxd930ea5d5a258f4f"
#define kWeChatAppSecret  @"0c806938e2413ce73eef92cc3"

#define kQQAppKey         @"1104675472"
#define kQQAppSecret      @"Wc4TJkRqyTjc0wDo"

#define UMENG_APPKEY      @"a022d89a3b48"


@implementation InitialShareSdk

+ (void)initialPlat
{
    NSLog(@"进入到------------>InitialShareSdk");
     //1.初始化ShareSDK应用,
    [ShareSDK registerApp:@"a022d89a3b48"];
    
    //开启QQ空间网页授权开关(optional)
    id<ISSQZoneApp> app =(id<ISSQZoneApp>)[ShareSDK getClientWithType:ShareTypeQQSpace];
    [app setIsAllowWebAuthorize:YES];
    
    
    /**
     连接新浪微博开放平台应用以使用相关功能，此应用需要引用SinaWeiboConnection.framework
     http://open.weibo.com上注册新浪微博开放平台应用，并将相关信息填写到以下字段
     **/
    [ShareSDK connectSinaWeiboWithAppKey:kWeiboAppKey
                               appSecret:kWeiboAppSecret
                             redirectUri:kWeiboRedirectURI
                             weiboSDKCls:[WeiboSDK class]];
    
    [ShareSDK connectSinaWeiboWithAppKey:kWeiboAppKey appSecret:kWeiboAppSecret redirectUri:kWeiboRedirectURI];
    
    /**
     连接QQ空间应用以使用相关功能，此应用需要引用QZoneConnection.framework
     http://connect.qq.com/intro/login/上申请加入QQ登录，并将相关信息填写到以下字段
     
     如果需要实现SSO，需要导入TencentOpenAPI.framework,并引入QQApiInterface.h和TencentOAuth.h，将QQApiInterface和TencentOAuth的类型传入接口
     **/
    [ShareSDK connectQZoneWithAppKey:kQQAppKey
                           appSecret:kQQAppSecret
                   qqApiInterfaceCls:[QQApiInterface class]
                     tencentOAuthCls:[TencentOAuth class]];
    
    /**
     连接QQ应用以使用相关功能，此应用需要引用QQConnection.framework和QQApi.framework库
     http://mobile.qq.com/api/上注册应用，并将相关信息填写到以下字段
     **/
    //旧版中申请的AppId（如：QQxxxxxx类型），可以通过下面方法进行初始化
    //    [ShareSDK connectQQWithAppId:@"QQ075BCD15" qqApiCls:[QQApi class]];
    
    [ShareSDK connectQQWithQZoneAppKey:kQQAppKey
                     qqApiInterfaceCls:[QQApiInterface class]
                       tencentOAuthCls:[TencentOAuth class]];
    
    /**
     连接微信应用以使用相关功能，此应用需要引用WeChatConnection.framework和微信官方SDK
     http://open.weixin.qq.com上注册应用，并将相关信息填写以下字段
     **/
//        [ShareSDK connectWeChatWithAppId:kWeChatAppKey wechatCls:[WXApi class]];
    [ShareSDK connectWeChatWithAppId:kWeChatAppKey
                           appSecret:kWeChatAppSecret
                           wechatCls:[WXApi class]];
    
    //连接短信分享
    [ShareSDK connectSMS];
    
    //连接拷贝
    [ShareSDK connectCopy];
    
    //连接邮件
    [ShareSDK connectMail];
}

@end
